using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
    public int a = 0;             //蛇身的生成有关
    public GameObject Cube;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        Move();
    }
    public void Move()
    {
        if(Input.GetKeyDown(KeyCode.W))
        {
           a = 1 ;
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
           a = 2 ;
        }
        if (Input.GetKeyDown(KeyCode.A))
        {
           a = 3 ;
        }
        if (Input.GetKeyDown(KeyCode.D))
        {
           a = 4 ;
        }
    }
    public void Touch()
    {
        if(transform.position == Cube.transform.position)
        {
            a+=1;
        }
    }
}
